package net.minecraft.src;

import java.util.Random;

public class WorldProviderPrePrehistoric extends WorldProvider
{

    public WorldProviderPrePrehistoric()
    {
		isNether = false;
        isHellWorld = false;
        hasNoSky = false;
		worldType = 5;
		colorsSunriseSunset = new float[4];
    }
	
	public void registerWorldChunkManager()
    {
        worldChunkMgr = new WorldChunkManagerPPH(worldObj);
		worldType = 5;
    }
	
    public IChunkProvider getChunkProvider()
    {
        return new ChunkProviderPPH(worldObj, worldObj.getWorldSeed());
    }

	public boolean canCoordinateBeSpawn(int i, int j)
    {
        int k = worldObj.getFirstUncoveredBlock(i, j);
        if(k == 0)
        {
            return false;
        } else
        {
            return Block.blocksList[k].blockMaterial.getIsSolid();
        }
    }
	
	public float[] calcSunriseSunsetColors(float f, float f1)
    {
        float f2 = 0.4F;
        float f3 = MathHelper.cos(f * 3.141593F * 2.0F) - 0.0F;
        float f4 = -0F;
        if(f3 >= f4 - f2 && f3 <= f4 + f2)
        {
            float f5 = ((f3 - f4) / f2) * 0.5F + 0.5F;
            float f6 = 1.0F - (1.0F - MathHelper.sin(f5 * 3.141593F)) * 0.99F;
            f6 *= f6;
            colorsSunriseSunset[0] = f5 * 0.2F + 0.2F;
            colorsSunriseSunset[1] = f5 * f5 * 0.1F + 0.1F;
            colorsSunriseSunset[2] = f5 * f5 * 0.3F + 0.7F;
            colorsSunriseSunset[3] = f6;
            return colorsSunriseSunset;
        } else
        {
            return null;
        }
    }
	
	public Vec3D func_4096_a(float f, float f1)
    {
        float f2 = MathHelper.cos(f * 3.141593F * 2.0F) * 2.0F + 0.5F;
        if(f2 < 0.0F)
        {
            f2 = 0.0F;
        }
        if(f2 > 1.0F)
        {
            f2 = 1.0F;
        }
        float f3 = 0.5F;
        float f4 = 0.7F;
        float f5 = 0.7F;
        f3 *= f2 * 0.94F + 0.06F;
        f4 *= f2 * 0.94F + 0.06F;
        f5 *= f2 * 0.91F + 0.09F;
        return Vec3D.createVector(f3, f4, f5);
    }
	
	public boolean canRespawnHere()
    {
        return false;
    }

	public float getCloudHeight()
    {
        return 115F;
    }

	private float colorsSunriseSunset[];
}
